function getStyleXml() {
    $.ajax({
        type: "GET",
        url: "/static/xml/style.xml",
        dataType: "xml",
        success: update_styleXml
    });
};

var styleXml = null;
function update_styleXml(xml){
	styleXml = xml;
	$(xml).find("style").each(function(){
		$(document.createElement("option")).attr("value", $(this).attr("id")).text($(this).attr("name"))
			.appendTo("select#css-template");
	});
}

function xmlParser(xml) {

    $('#load').fadeOut();

    $(xml).find("Book").each(function () {

        $(".main").append('<div class="book"><div class="title">' + $(this).find("Title").text() + '</div><div class="description">' + $(this).find("Description").text() + '</div><div class="date">Published ' + $(this).find("Date").text() + '</div></div>');
        $(".book").fadeIn(1000);

    });

}
